﻿
function setElementValue(elementname, id) {
    $("#" + elementname).css("display", "none");
    $("#" + elementname).text(id);
}

function displayResult(id,elementname) {
    $("#" + elementname + " .TB_resultbox").remove();
var imgtext="";
switch (id) {
    case 1:
        imgtext = "<img  src='../buttons/ok.png' /> <label class='smallgreentext'>Operation Successful</label>";
        break;
    case -1:
    case 0:
        imgtext = "<img  src='../buttons/cancel.png' /> <label class='smallredtext'>Operation Failed</label>";
        break;
}
$("#" + elementname).append("<div class='TB_resultbox'>" + imgtext + "</div>");
}

function clearInput(elementname) {
    if (elementname == "")
        elementname = "TB_window";
    $("#" + elementname + " INPUT[type='text']").val("");
}